package com.ylml.demo.jersey.api;

import com.ylml.demo.jersey.service.DemoService;
import org.springframework.beans.factory.annotation.Autowired;

import javax.ws.rs.GET;
import javax.ws.rs.Path;
import javax.ws.rs.Produces;
import javax.ws.rs.core.MediaType;

@Path("/demo_api")
public class DemoApi {

    private DemoService demoService;

    @GET
    @Produces(MediaType.TEXT_PLAIN)
    public String getIt() {
        return demoService.getIt();
    }

    @Autowired
    public void setDemoService(DemoService demoService) {
        this.demoService = demoService;
    }
}
